package com.qining618.cms.cms.mapper;

import com.qining618.cms.cms.domain.ChannelContent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * CMS栏目内容关联表 Mapper 接口
 * </p>
 *
 * @author qining
 * @date 2019-09-17
 */
@Mapper
@Repository
public interface ChannelContentMapper extends BaseMapper<ChannelContent> {

    /**
     * 根据栏目id删除栏目内容关联信息
     * @param channelId 栏目id
     * @return int
     */
    @Delete("delete from c_channel_content where channel_id = #{channelId}")
    int deleteByChannelId(@Param("channelId") Long channelId);

    /**
     * 根据内容id删除栏目内容关联信息
     * @param contentId 内容id
     * @return int
     */
    @Delete("delete from c_channel_content where content_id = #{contentId}")
    int deleteByContentId(@Param("contentId") Long contentId);

}
